home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 37
/
Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso
/
Aminet
/
util
/
wb
/
autogui.lha
/
AutoGui
/
AutoGui.gc
next >
Wrap
Text File
|
2000-02-16
|
21KB
|
811 lines
G4C
; AutoGui.gc v 1.0 by dck@hol.gr (Set TABs to 3)
; ------------------------------------------------------------
; This gui will take ask you for a program and then, from the
; command template of that program (if there is one) will
; construct a complete workable gui.
; ------------------------------------------------------------
WINBIG 121 24 227 154 'Automatic Guis Ltd.'
WinType 11110001
ResInfo 8 640 256
xOnClose
GuiQuit #This
xOnQuit
GuiQuit AutoPrefs
guiquit AutoEdit
guiquit AutoHelp
guiquit AutoSlider
xOnRMB
guiclose AutoHelp
; ------------------------------------------------------------
; STARTUP
; ------------------------------------------------------------
xOnLoad command
setgad #this 1/9 hide ; hide lvs
setgadvalues #this
setgadvalues AutoPrefs ; the other gui
setgad AutoPrefs 7 OFF ; the box attr textin gad
guiopen #this
gosub #this GetCommand $command
xOnReload newcommand
guiopen #this
guiscreen #this front
if $newcommand > ''
command = $newcommand
newcommand = ''
gosub #this GetCommand $command
endif
; ------------------------------------------------------------
; The GUI
; ------------------------------------------------------------
XTEXTIN 0 0 212 14 "" outfile "(Enter GuiFile name)" 130
gadhelp 'Enter the name of the Gui to be created'
attr resize 0020
gadid 15
XBUTTON 212 0 14 14 "<"
gadhelp 'Choose the directory into which to save the Gui'
attr resize 2000
ReqFile -1 -1 300 -40 "Choose Directory for gui" DIR dirname ""
joinfile $dirname $comname\.gc outfile
Update #this 15 $outfile
XLISTVIEW 0 14 125 140 "" lvargs "" 0 SHOW
gadhelp 'These are the Command Line Arguments in standard Amiga format'
attr resize 0022
gadid 10
XBUTTON 126 14 50 14 "Up"
gadhelp 'Move currently selected argument UP in list'
attr resize 2000
lvuse #this 10
if $$lv.line <= 0 ; top line..
stop
endif
temp = $$lv.rec
lvgo prev
temp2 = $$lv.rec
lvput $temp
lvgo next
lvput $temp2
lvgo prev
lvmove 0
XBUTTON 177 14 49 14 "Down"
gadhelp 'Move currently selected argument DOWN in list'
attr resize 2000
lvuse #this 10
temp == $$lv.tot - 1
if $$lv.line >= $temp ; bottom line..
stop
endif
temp = $$lv.rec
lvgo next
temp2 = $$lv.rec
lvput $temp
lvgo prev
lvput $temp2
lvgo next
lvmove 0
XBUTTON 126 28 50 14 "Edit"
gadhelp 'Edit currently selected argument'
attr resize 2000
guiopen AutoEdit AutoGui.gc PutToList "Edit command option:" $AutoGui.gc/lvargs
xRoutine PutToList
lvuse #this 10
lvput $AutoEdit/string
XBUTTON 177 28 49 14 "Add"
gadhelp 'Add a Command line argument - in standard Amiga format'
attr resize 2000
guiopen AutoEdit AutoGui.gc AddToList "Add a CLI command option:" ""
xRoutine AddToList
lvuse #this 10
lvadd $AutoEdit/string
XBUTTON 177 42 49 14 "Com"
gadhelp 'Manually enter the name of the command (or program) to run'
attr resize 2000
guiopen AutoEdit AutoGui.gc SetCommName "Enter full path & name of Command:" ""
xRoutine SetCommName
compath = $AutoEdit/string
extract compath file comname
SetWinTitle #this $comname
extract compath path outfile
joinfile $outfile $comname\.gc outfile
update #this 15 $outfile
XBUTTON 126 42 50 14 "Del"
gadhelp 'Remove currently selected argument from the list'
attr resize 2000
lvuse #this 10
lvdel -1
lvgo next
lvmove 0
XBUTTON 126 56 100 14 "Prefs.."
gadhelp 'Adjust the look of the gui in various ways'
attr resize 2000
guiopen AutoPrefs
XTEXTBOX 126 84 100 42 "" ""
attr resize 2002
attr tbox 2/1/3/button/out
XBUTTON 126 126 100 14 "New.."
gadhelp 'Choose a new command to give a gui to - it will be run to get its arguments'
attr resize 2200
gosub #this GetCommand ''
update autoprefs 8 '' ; reset helpfile
; ------------------------------------------------------------
; CREATE the gui
; ------------------------------------------------------------
XBUTTON 126 140 100 14 "Create!"
gadhelp 'Create a Gui, based on the arguments listed'
attr resize 2200
local botpos/srcicon/desticon
gosub #this ResetSizes ; get default sizes
; Start constructing file (TOP/BOT at lines 14/15 - no change!)
.temp = 'G4C\n\nWinBig\nWinType 11110001\nResInfo $fontsize $screenx $screeny\n\nxOnLoad\n\tGuiOpen #this\n\nxOnClose\n\tGuiQuit #this\n\n; Decorative TextBoxes\nTOP\nBOT\n'
lvuse #this 1
lvchange env:.temp
delvar .temp
; set winfont
if $AutoPrefs/font > ''
lvadd 'WinFont $AutoPrefs/font 000\n'
endif
lvadd '; -------------------- Gadgets ---------------------\n'
lvuse #this 10 ; add all gadgets..
if $$lv.tot = 0
stop ; no args..
endif
lvgo first
while $$lv.line > ''
arg = $$lv.rec
if $arg > ' ' ; skip blanks..
gosub #this addgadget
endif
lvuse #this 10
lvgo next
endwhile
; add top box
gosub #this GetPosition $width $ysize
++ypos ; leave a pixel..
lvuse #this 1
; edit top box line
lvgo #13
lvput 'xTextBox 0 0 0 $ypos "" ""\n\tAttr TBox $autoprefs/topbox'
if $AutoPrefs/pipe = ON
lvadd '; -------------------- Pipe: Output --------------------'
lvadd ''
lvadd 'xPIPE PIPE:$comname ON\n\tGadID 901\n\tUpdate #this 902 \$\$pipe.txt\n'
lvadd 'xTextBox 0 $ypos 0 $tiheight "" "Idle."'
lvadd '\tAttr TBox $autoprefs/midbox\n\tGadID 902\n'
ypos = $($ypos + $tiheight)
endif
botpos = $ypos
; add the command construction & execute code (lv2)
lvadd '; -------------------- Execution ---------------------\n'
ypos = $($ypos + $ydist + 1)
lvadd 'xBUTTON $($winmargin +3) $ypos 80 $ysize Execute'
lvadd '\tcomline = ""'
lvuse #this 2
lvgo first
lvclip cut -1 add #this 1
lvuse #this 1
lvadd "\tSetStack $AutoPrefs/stack"
if $AutoPrefs/pipe = ON
lvadd "\tRUN '$compath >PIPE:$comname \$comline'"
else
lvadd "\tRUN '$compath \$comline'"
endif
lvadd "\tSetStack 4096" ; reset to default..
; add the CANCEL button
lvadd '\nxBUTTON $($width - 80 - $winmargin -3) $ypos 80 $ysize Abort'
lvadd '\tBreakTask $compath CD'
; add a HELP button, if defined
if $autoprefs/helpfile > ''
lvadd '\nxBUTTON $($winmargin +84) $ypos 60 $ysize Help..'
lvadd '\tRun "multiview $autoprefs/helpfile"'
endif
; change winbig line..
lvgo #2
ypos = $($ypos + $ysize + $ydist + 1) ; total height..
lvput 'WinBig -1 -1 $width $ypos "Gui 4 $comname"'
; add bottom box (to the top of file)
lvgo #14
lvput 'xtextbox 0 $botpos 0 $($ypos - $botpos) "" ""\n\tAttr TBox $autoprefs/botbox'
; Add command to set the 1st textin gadget on..
if $firstgad > 0
lvgo #7
lvput '\tGuiOpen #this\n\tSetGad #this $firstgad ON'
endif
; save file..
lvadd '\n'
lvsave $outfile
; start (or re-start) gui..
extract outfile file outname
ifexists gui $outname
guiclose $outname
guirename $outname gui_dead
guiquit gui_dead
endif
guiload $outfile
; save icon if wanted..
if $autoprefs/icon = ON
extract #this guipath srcicon
joinfile $srcicon DefGuiIcon srcicon
extract outfile path desticon
joinfile $desticon $outname\.info desticon
copy $srcicon $desticon
endif
; ------------------------------------------------------------
; Invisible LISTVIEWS
; ------------------------------------------------------------
; used for file handling
XLISTVIEW 0 0 257 131 '' line '' 0 MULTI
gadid 1
; for storing commandline construction code
XLISTVIEW 0 0 257 131 '' line '' 0 MULTI
gadid 2
; ------------------------------------------------------------
; GET COMMAND & extract the template into lv10
; ------------------------------------------------------------
xROUTINE GetCommand command
if $command = ''
; get the command..
reqfile -1 -1 300 -40 'Choose command:' LOAD command c:
if $command = ''
return
endif
endif
compath = $command
extract compath file comname
; get the command template
failat 25 ; so that failures do not stop us..
setstack $AutoPrefs/stack
cli '$command ? >T:temp <NIL:'
setstack 4096
lvuse #this 1
lvchange T:temp
lvgo first
command = $$lv.rec
if $command = '' ; nothing..
return
endif
; get all commandline args into listview
lvuse #this 10
lvclear
; replace all comas with spaces, so as to separate args
repvar command ',' ' ' cs
cutvar command cut word 1 arg ; get 1st argument
while $arg > ' '
extract arg clean arg ; clean surrounding spaces
if $arg[-1][1] = ':' ; its the last arg..
cutvar arg cut char -1 '' ; crop trailing ':'
command = '' ; ensure endwhile
endif
; check for '=' and keep last part
repvar arg '=' ' ' cs
parsevar arg
if $$parse.tot > 1
cutvar arg cut word -1 arg
extract arg clean arg
endif
lvadd '$arg'
cutvar command cut word 1 arg ; get next argument
endwhile
; update output name (keep path)
outfile = $compath\.gc
update #this 15 $outfile
Setwintitle #this $comname
failat 10
xonfail
ezreq "If you get this error when you choose a\nnew command, it's ok.. I ran the command\nto get its template." Phew!.. ''
; ------------------------------------------------------------
; ADD A GADGET (according to arg type)
; ------------------------------------------------------------
xROUTINE addgadget ; argument is in arg
local c/type/musthave/isnum/x/w/style
lvuse #this 1
; split arg at the /
repvar arg '/' ' ' cs
parsevar arg
name = $$parse.0
; convert name to title/lowercase (looks better)
extract name lower name
temp = $name[0][1]
extract temp upper temp
name[0][1] = $temp
musthave = 0
multi = 0
isnum = 0
type = 'I' ; I=anything..
; go through all readargs switches, changing above defaults..
c = 1
while $c <= $$parse.tot
temp = '\$\$parse.$c'
extract temp upper temp
; do special cases..
if $temp = 'T' ; toggle is same as switch
or $temp = 'S'
type = 'S'
elseif $temp = 'M' ; both taken as multi
or $temp = 'F'
multi = 1
elseif $temp = 'N'
isnum = 1
elseif $temp = 'A'
musthave = 1
elseif $temp = 'K'
type = 'K'
endif
++c
endwhile
; set type of title
titstyle = $AutoPrefs/titstyle
style = "2/1/shadow/lside/middle/$name" ; default
if $titstyle = PLAIN
style = "1/1/plain/lside/middle/$name"
elseif $titstyle = WHITE
style = "2/1/plain/lside/middle/$name"
elseif $titstyle = OUTLINE
style = "2/1/outline/lside/middle/$name"
elseif $titstyle = OUTLINE2
style = "3/1/outline/lside/middle/$name"
endif
; ----- add gadgets as per type..
if $type = 'S' ; SWITCHES
gosub #this GetPosition $cbwidth $cbheight
lvadd "xCheckBox $xpos $ypos $cbwidth $cbheight '' $name $name '' OFF"
lvadd '\tAttr Title $style'
; comline contruction instructions
lvuse #this 2
lvadd '\tIf \$$name > ""'
lvadd '\t\tAppVar comline " $name"'
lvadd '\tEndif'
lvuse #this 1
else ; KEYWORDS & PLAIN
; see which width to use..
w = $tiwidth
if $isnum = 1
w = $niwidth
endif
gosub #this GetPosition $w $tiheight
lvadd "xTextIn $xpos $ypos $w $tiheight '' $name '' 100"
lvadd '\tAttr Title $style'
if $isnum = 1 ; add number filter
lvadd '\tAttr TIType INT'
else ; if its not a number gadget, add file request button..
temp = $($xpos + $w +1) ; to pass as argument..
gosub #this addreq $temp $multi
endif
lvuse #this 2 ; add execution code..
lvadd '\tIf \$$name > ""'
; append the commandline option..
if $type = 'K' ; give keyword
lvadd '\t\tAppVar comline " $name\=\$$name"'
else
lvadd '\t\tAppVar comline " \$$name"'
endif
; if its /A, it obligatory..
if $musthave = 1
lvadd '\tElse'
lvadd '\t\tEzReq "Incomplete argument:\\nOption <$name\> must be given!" OK ""'
lvadd '\t\tStop'
endif
lvadd '\tEndif'
lvuse #this 1
endif
lvadd '' ; blank line..
; ------------------------------------------------------------
; --------- Add a file requester to xtextin gads
; ------------------------------------------------------------
xRoutine AddReq ; pass: $$arg.0=leftpos $$arg.1=multi
lvadd '\tGadID $gadcount'
lvadd ''
lvadd 'xBUTTON $$arg.0 $ypos 15 $tiheight "<"'
if $$arg.1 = 1
lvadd '\tReqFile -1 -1 300 -40 "Select $name (multiple)" MULTI $name ""'
else
lvadd '\tReqFile -1 -1 300 -40 "Choose a $name" LOAD $name ""'
endif
lvadd '\tUpdate #this $gadcount \$$name'
++gadcount
; ------------------------------------------------------------
; --------- calc the X,Y position...
; ------------------------------------------------------------
xRoutine GetPosition gw gh
local sameline
if $ypos = 0 ; first time..
xpos = $($winmargin + $titmargin)
ypos == $ydist + 2
sameline = 1
; see if it fits, width wise..
elseif $($xpos + $lastgadwidth + $titmargin + $gw + $winmargin) < $width
xpos = $($xpos + $lastgadwidth + $titmargin) ; add xdist??
; ypos remains unchanged..
sameline = 1
else
xpos = $($winmargin + $titmargin)
ypos = $($ypos + $lastgadheight + $ydist)
sameline = 0
endif
if $sameline = 0 ; if >1 gads on same line, remember
lastgadheight = $gh ; the tallest height for next line..
else
if $lastgadheight < $gh
lastgadheight = $gh
endif
endif
lastgadwidth = $gw
; ------------------------------------------------------------
; GET SIZES & DISTANCES
; ------------------------------------------------------------
xROUTINE ResetSizes
info gui #this ; get info from the front screen
maxheight == $$screen.h - 30 ; max gui height
ysize == $$screen.bar + 3 ; gadget height (buttons etc)
screenx = $$screen.w ; get these for resinfo..
screeny = $$screen.h
fontsize == $$screen.bar - 2
; get settings from AutoPrefs gui
width = $autoprefs/width
winmargin = $autoprefs/winmargin
titmargin = $autoprefs/titmargin
ydist = $autoprefs/ydist
; calculate various positions from above info..
xpos = $($winmargin + $titmargin)
ypos = 0 ; used as first time flag..
; initialize sizes for textin gads
tiwidth = $($width - $xpos - 18 - $winmargin)
tiheight == $$screen.bar + 4
niwidth = $($$screen.bar * 10) ; number gadgets??
; initialize these for checkboxes..
cbpos = 0
cbheight == $$screen.bar + 2
cbwidth == $screenx / 27 ; approximate..
cbstep = $($titmargin + $cbwidth + 1)
gadcount = 1 ; for giving gadids
lastgadheight = 0 ; for GetPosition()
lastgadwidth = 0
firstgad = 0 ; for setgading the 1st textbox
; ------------------------------------------------------------
; HELP
; ------------------------------------------------------------
XBUTTON 126 70 73 14 Help
attr resize 2000
local guidename/mypath
gadhelp 'Load the AutoGui guide'
extract #this guipath mypath
joinfile $mypath AutoGui.guide guidename
ifexists file $guidename
run 'multiview $guidename'
else
ezreq 'The AutoGui guide was not found..\nFile: $guidename' Ok ''
endif
XCHECKBOX 200 70 26 14 "" help "ON" "OFF" OFF
attr resize 2000
gadhelp 'Help is now $help'
if $help = ON
setgad #this 55 ON
else
guiclose AutoHelp
setgad #this 55 OFF
endif
xOnHelp OFF
gadid 55
local oldtext
if $$help.text != $oldtext
guiclose AutoHelp
guiopen AutoHelp $$help.text AutoGui.gc
oldtext = $$help.text
endif
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; ===============================================================
NEWFILE AutoEdit ; Edit strings
; ===============================================================
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
WINBIG 65 109 436 14 ""
WinType 11110010
resinfo 8 640 256
xOnOPEN gui rtn title string
guiopen #this
guiwindow AutoGui.gc wait
setwintitle #this '$title'
update #this 1 $string
setgad #this 1 ON
xOnClose
guiwindow AutoGui.gc Resume
XTEXTIN 0 0 0 0 "" string "" 150
gadid 1
guiclose #this
gosub $gui $rtn
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; ===============================================================
NEWFILE AutoHelp ; Show help boxes..
; ===============================================================
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
winbig 0 0 180 50 ''
wintype 000010
resinfo 8 640 256
winonmouse -20 12
xOnRMB
guiclose #this
xOnOpen text gui
; info variable text
; width = $(($$var.length * 8) + 6) ; using 8 point font..
update #this 1 '$text'
guiwindow $gui on
xTEXTBox 0 0 0 0 '' ''
gadid 1
attr tbox 2/1/3/button/out
; attr tbstyle 2/1/shadow/center
attr tbstyle 2/1/plain/center
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; ===============================================================
NEWFILE AutoSlider ; Get a numeric argument
; ===============================================================
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
WINBIG 112 69 342 14 ""
WinType 11110010
WinOnMouse 200 7
resinfo 8 640 256
BOX 267 0 41 14 out button
attr resize 2002
xOnOPEN gui rtn title min max newval
guiwindow $gui wait
changearg #this 1 7 $max
changearg #this 1 6 $min
guiopen #this
update #this 1 $newval
redraw #this
setwintitle #this '$title ($min\-$max\)'
xOnClose
guiwindow $gui Resume
XHSLIDER 0 0 267 14 '' val 0 100 50 "%ld"
attr resize 0022
gadid 1
XBUTTON 309 0 32 14 Ok
attr resize 2002
guiclose #this
gosub $gui $rtn
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; ===============================================================
NEWFILE AutoPrefs ; various settings
; ===============================================================
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
WINBIG 101 35 436 133 AutoPrefs
WinType 11110001
ResInfo 8 640 256
BOX 0 0 436 133 out button
XTEXTIN 136 6 50 14 "" width "300" 10 ; WIDTH
Attr Title '2/1/shadow/lside/middle/Gui width:'
Attr TIType INT
gadid 1
XBUTTON 188 6 15 14 "<"
guiopen AutoSlider AutoPrefs SetWidth "Set Gui width:" 150 620 $width
xRoutine SetWidth
width = $AutoSlider/val
update #this 1 $width
XTEXTIN 136 20 50 14 "" winmargin "5" 10 ; WINMARGIN
Attr Title '2/1/shadow/lside/middle/Window margins:'
Attr TIType INT
gadid 2
XBUTTON 188 20 15 14 "<"
guiopen AutoSlider AutoPrefs SetWinMargin "Set window margins:" 0 20 $winmargin
xRoutine SetWinMargin
winmargin = $AutoSlider/val
update #this 2 $winmargin
XTEXTIN 136 34 50 14 "" titmargin "65" 10 ; TITMARGINS
Attr Title '2/1/shadow/lside/middle/Title margins:'
Attr TIType INT
gadid 3
XBUTTON 188 34 15 14 "<"
guiopen AutoSlider AutoPrefs SetTit "Set margin to leave for titles:" 40 150 $titmargin
xRoutine SetTit
titmargin = $AutoSlider/val
update #this 3 $titmargin
XTEXTIN 136 48 50 14 "" ydist "3" 10 ; YDIST
Attr Title '2/1/shadow/lside/middle/Gadget distance:'
Attr TIType INT
gadid 4
XBUTTON 188 48 15 14 "<"
guiopen AutoSlider AutoPrefs SetYDist "Distance between gadgets:" 0 20 $ydist
xRoutine SetYDist
ydist = $AutoSlider/val
update #this 4 $ydist
XTEXTIN 345 6 58 14 "" stack "4096" 10 ; STACK
Attr Title '2/1/shadow/lside/middle/Program Stack:'
Attr TIType INT
gadid 5
XBUTTON 408 6 15 14 "<"
guiopen AutoSlider AutoPrefs SetStack "Set Stack (Kbytes) for the program:" 3 30 $($stack / 1024)
xRoutine SetStack
stack = $($AutoSlider/val * 1024)
update #this 5 $stack
; XTEXTIN 345 21 50 14 "" "winmargin" "5" 10
; XBUTTON 396 21 15 14 "<"
; XTEXTIN 345 36 50 14 "" "winmargin" "5" 10
; XBUTTON 396 36 15 14 "<"
; XTEXTIN 345 51 50 14 "" "winmargin" "5" 10
; XBUTTON 396 51 15 14 "<"
; -------- textbox & title styles
CTEXT 51 70 "Box Attributes:" #screen 8 2 -1 00011
XTEXTIN 51 81 155 13 "" topbox "2/1/0/button/out" 100
Attr Title '2/1/shadow/lside/middle/Top'
XTEXTIN 51 96 155 14 "" midbox "2/1/0/button/out" 100
Attr Title '2/1/shadow/lside/middle/Mid'
gadid 7
XTEXTIN 51 111 155 14 "" "botbox" "2/1/3/button/out" 100
Attr Title '2/1/shadow/lside/middle/Bot'
XCYCLER 276 54 147 14 "" titstyle
CSTR Shadow SHADOW
CSTR Plain PLAIN
cstr White WHITE
cstr Outline OUTLINE
cstr Outline2 OUTLINE2
Attr Title '2/1/shadow/lside/middle/Titles:'
; -------- font
XTEXTIN 276 39 130 14 "" font "" 100
Attr Title '2/1/shadow/lside/middle/Font:'
gadid 6
XBUTTON 408 39 15 14 "<"
local myfont/size
myfont = ''
ReqFile -1 -1 300 -40 'Choose a Font (size):' LOAD myfont FONTS:
if $myfont > ''
extract myfont file size
extract myfont path myfont
extract myfont file myfont
appvar myfont .font
font = "$myfont $size"
update #this 6 $font
endif
; ----------- add pipe
XCHECKBOX 396 21 26 14 "" pipe "ON" "OFF" OFF
Attr Title '2/1/shadow/lside/middle/Add Pipe: Output'
if $pipe = ON
setgad #this 7 ON ; enable box attr gadget
else
setgad #this 7 OFF
endif
; ----------- add a Help file
XTEXTIN 276 69 130 14 "" helpfile "" 130
gadhelp 'Add a button to load Help file for command'
Attr Title '2/1/shadow/lside/middle/Help'
gadid 8
XBUTTON 408 69 15 14 "<"
gadhelp 'Choose a Help file'
helpfile = ''
ReqFile -1 -1 300 -40 'Choose a Help file:' LOAD helpfile ''
update #this 8 $helpfile
; ----------- add icon
XCHECKBOX 396 85 26 14 "" icon "ON" "OFF" OFF
Attr Title '2/1/shadow/lside/middle/Add Icon'